package com.vdong.trade.trading.facade.enums;

/**
 * @author <a href="mailto:clf@vdongzc.com">clf</a>
 * @Description: 支付类型相关枚举
 * @Date Create on 2018-12-13 15:10:22
 * @since version1.0
 */
public enum PayChannelEnum {

    ALI_PAY("alipay", "阿里支付渠道"),
    WECHAT_PAY("wechat_pay", "微信支付渠道");

    private String code;

    private String desc;

    PayChannelEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static PayChannelEnum getEnumByCode(String code) {
        for (PayChannelEnum channelEnum : PayChannelEnum.values()) {
            if (channelEnum.getCode().equals(code)) {
                return channelEnum;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
